package cn.springcloud.fix.es.controller;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@RestController
@RequestMapping("/t")
public class IndexController {

    @GetMapping("/t")
    public String list() {
        ExecutorService executorService = Executors.newFixedThreadPool(2);
        for (int i = 1; i < 10; i++) {
            executorService.execute(new ExecuteTaskRunnable(i));
        }
        executorService.shutdown();
        return "OK";
    }
}
